package chapter4;
//定义Animal{
class Animal2{
    //定义动物叫的方法
    void shout(){
        System.out.println("动物发出叫声");
    }
}
//定义Dog类继承Animal类
class Dog2 extends Animal2{
    void shout(){
        System.out.println("汪汪汪");
    }
}
//定义测试类
public class Example03 {
    public static void main(String []args){
        Dog2 dog2 = new Dog2();
        dog2.shout();
    }
}
